<?php
use yii\helpers\Url;
use yii\web\View;
use app\assets\ModifyPwdAsset;
ModifyPwdAsset::register($this); 
$this->title = $this->context->pageTitle.Yii::$app->params['titleSuffix'];
$this->params['breadcrumbs'] = [
  \Yii::t('home', 'Account Management'),
  \Yii::t('home', 'Update Password')
];
$jsMsgs = $this->context->loadJsMsgs([
  'modifyPwdForm',
]);
$this->registerJs("VAM.setVar('LANGUAGE_JS', '".$jsMsgs."');", View::POS_HEAD);
?>
<div class="page-header">
  <h1>
    <?=\Yii::t('home', 'Account Management')?>
    <small><?=\Yii::t('home', 'Update Password')?></small>
  </h1>
</div>
<div class="panel">
  <div class="panel-heading">
  </div>
  <div class="panel-body">
    <div class="row">
      <div class="col-sm-6 col-sm-offset-3">
        <form class="form-horizontal" id="data-frm" method="POST" action="<?php echo Url::to(['home/user-update-handle']);?>">
          <fieldset>
            <legend><?=\Yii::t('home', 'Account Info')?></legend>
            <div class="form-group">
              <label class="col-sm-3 control-label" for="user_name" >
                <?=\Yii::t('home', 'Username')?>：
              </label>
              <div class="col-sm-9">
                <p class="form-control-static"><strong><?=$user['name'] ?></strong></p>
                <div class="help-block text-error" id="user_name_err"></div>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-3 control-label" for="user_pwd">
                <em>*</em>
                <?=\Yii::t('home', 'Password')?>：
              </label>
              <div class="col-sm-9">
                <input class="form-control" id="user_pwd" type="password" name="user_pwd" value="" placeholder="">
                <div class="help-block text-error" id="user_pwd_err"></div>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-3 control-label" for="confirm_pwd">
                <em>*</em>
                <?=\Yii::t('home', 'Confirm Password')?>：
              </label>
              <div class="col-sm-9">
                <input class="form-control" id="confirm_pwd" type="password" name="confirm_pwd" value="" placeholder="">
                <div class="help-block text-error" id="confirm_pwd_err"></div>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-3 control-label" for="email_address">
                <em>*</em>
                <?=\Yii::t('home', 'Email')?>：
              </label>
              <div class="col-sm-9">
                <input class="form-control" id="email_address" type="text" name="email" value="<?= $user['email'] ?>" placeholder="example@example.com" readonly>
                <div class="help-block text-error" id="email_address_err"></div>
              </div>
            </div>
          </fieldset>
          <fieldset>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-10 col-xs-offset-3 col-xs-6">
                <div class="btn-form-group pull-right">
                  <button type="submit" class="btn btn-primary"><?=\Yii::t('common', 'Save')?></button>
                  <a href="<?php echo Url::to(['home/dashboard']); ?>" class="btn btn-default"><?=\Yii::t('home', 'Back To Dashboard')?></a>
                </div>
              </div>
            </div>
          </fieldset>
        </form>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/home/userSettings.js"]);
  });
</script>